var app = getApp();
Page({
  data: {
    url: {
      getMyCoupon: app.url.baseUrl + '/my/getMyCoupon',
    },
    list: [],
    pageNumber: 1
  },
  //下拉触底
  onReachBottom: function () {
    this.getQuan()
  },
  onShow:function(){
    this.setData({pageNumber: 1,list : []})
    this.getQuan()
  },
  onLoad: function (options) {
   
  },
  //详情
  getQuan: function (e) {
    var that = this
    app.ajax(this.data.url.getMyCoupon, { pageNumber: this.data.pageNumber }, function (res) {
      var d = res.data
      if (d.code != 2000) {
       //提示
        return
      }
      if (d.data != null&&d.data.length>0) {
        var list = that.data.list
        for (var i = 0; i < d.data.length; i++) {
          list.push(d.data[i])
        }
        that.setData({ list: list,pageNumber: that.data.pageNumber += 1})
      }

    })
  },
  getQ:function(){
    wx.navigateTo({
      url: 'myquanhq/myquanhq',
    })
  }
})